package com.atguigu.contacts;

import java.util.Arrays;
public class ArrayTest4 {
	public static void main(String[] args) {
		ArrayUtils myUtils = new ArrayUtils();
		System.out.println(myUtils.length);
		int[] arr = new int[]{1,2,3,4,5,6,7};
		for (int i = 0; i < arr.length/2; i++) {
			// int temp = arr[i]; // 用一个临时变量 
			// 两个数相加 再减 就不用临时变量了
			arr[i] = arr[arr.length - 1- i] +  arr[i];
			arr[arr.length - 1- i] = arr[i] - arr[arr.length - 1- i];
			arr[i] = arr[i] - arr[arr.length - 1- i];
		}
		System.out.println(Arrays.toString(arr));
	}
}
